]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupSubMenu: Only remove padding when scrollbar is shown
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 6 Sep 2012 09:41:23 +0000 (11:41 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 6 Sep 2012 11:56:44 +0000 (13:56 +0200)
The special padding rules for submenu items currently ensure that
content aligns properly when the scrollbar is shown. While they
work nicely for the network menu, it looks odd for non-scrolled
submenus, so make this case explicit by introducing a :scrolled
pseudo class and adjust the style rules to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=683009

data/theme/gnome-shell.css
js/ui/popupMenu.js

index ec4eabece2739a3e80a7cabb8bc9e96d9f067938..d2bd3da79c43363976b8acb614d683837e8eb496 100644 (file)
@@ -151,11 +151,11 @@ StScrollBar StButton#vhandle:active {
     box-shadow: inset 0px 2px 4px rgba(0,0,0,0.9);
 }
 
-.popup-sub-menu .popup-menu-item:ltr {
+.popup-sub-menu:scrolled .popup-menu-item:ltr {
     padding-right: 0em;
 }
 
-.popup-sub-menu .popup-menu-item:rtl {
+.popup-sub-menu:scrolled .popup-menu-item:rtl {
     padding-left: 0em;
 }
 
index 5eba45f3aae25c687d6ca3667f9ceebae1a87a0d..5f8b999c2bfc6d88d40b13f86d5623c2ad6dc0c1 100644 (file)
@@ -1343,6 +1343,11 @@ const PopupSubMenu = new Lang.Class({
         this.actor.vscrollbar_policy =
             needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER;
 
+        if (needsScrollbar)
+            this.actor.add_style_pseudo_class('scrolled');
+        else
+            this.actor.remove_style_pseudo_class('scrolled');
+
         // It looks funny if we animate with a scrollbar (at what point is
         // the scrollbar added?) so just skip that case
         if (animate && needsScrollbar)